<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="com.cap.bts.framework.common.constant.BrandConstants" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <%@include file="../include/include.jsp"%>
	<link href="${csspath}/main.css" rel="stylesheet" type="text/css" />
	<link href="${csspath}/../bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
	<script src="${jspath}/jquery/jquery-1.4.4.js" type="text/javascript"></script>
	<script src="${jspath}/main.js" type="text/javascript"></script>
	<script src="${jspath}/jquery/jquery.ui.min.js" type="text/javascript"></script>
	<script src="${jspath}/public.js" type="text/javascript"></script>
	<script src="${jspath}/common.js" type="text/javascript"></script>
	<script src="${jspath}/../bootstrap/js/bootstrap.js" type="text/javascript"></script>	
	<script type="text/javascript" src="${jspath}/load_layer.js"></script>
	<script type="text/javascript" src="${jspath}/jquery/jquery.ui.draggable.js"></script>
	<script type="text/javascript" src="${jspath}/jquery/jquery.alerts.js"></script>
	<link rel="stylesheet" type="text/css" href="${csspath}/jquery.alerts.css" />
	<script type="text/javascript" src="${jspath}/jquery/jquery.ellipsis.js"></script>
<title>CRM</title>
    <script type="text/javascript">
    function registerShortcutEvent(){
 	   
 	   $(".shortcut").click(function(){
	   			var parentMenuName = $(this).attr("parentMenuName");
	   			var secondMenuName = $(this).attr("secondMenuName");
	   			$("#active1").text(parentMenuName);
				$("#active2").text(secondMenuName);
				
				showBoder();
	   		});
 	   
    }
    $(function(){
    $("#exit").click(function(){
		window.location.href = "${webcontext}/logout";
	});
	
	registerShortcutEvent();
	
});
    </script>
    <script type="text/javascript">
		
		//火狐识别innerText
		function isIE(){ //ie?
			if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1)
			return true;
			else
			return false;
			}
			
			if(!isIE()){ //firefox innerText define
			HTMLElement.prototype.__defineGetter__(     "innerText",
			function(){
			var anyString = "";
			var childS = this.childNodes;
			for(var i=0; i<childS.length; i++) {
			if(childS[i].nodeType==1)
			anyString += childS[i].tagName=="BR" ? '\n' : childS[i].textContent;
			else if(childS[i].nodeType==3)
			anyString += childS[i].nodeValue;
			}
			return anyString;
			}
			);
			HTMLElement.prototype.__defineSetter__(     "innerText",
			function(sText){
			this.textContent=sText;
			}
			);
		}
		
		// 得到一级、二级菜单值，写到active中
		$(function(){			
			$("#active1").hide();
			$("#active2").hide();			
			$(".menu_i").click(function(){
				var m1 = $(this).parent().parent(".menu_list").parent(".Mainmenu").children().eq(0).text();
				var m2 = $(this).text();
				$("#active1").text(m1);
				$("#active2").text(m2);
			});			
		});
		
		$(function(){
	    	$('#subMenu li').bind('click', function() {
				if (window.cur)
					window.cur.style.background = "";
				this.style.background = "#e8e8e8";
				window.cur = this;
			});
	    });
    </script>
    
    <%--sso script --%>

<%
if(request.getSession(true).getAttribute("IS_SSO_LOGIN")!=null){
	
	String objectId = (String)request.getSession().getAttribute("userObjectId");
	String logoutUrl=com.cap.bts.framework.auth.util.SSOConfigurations.getConfig("dealer.portal.universalout");
	String paras = logoutUrl+"&"+objectId;
	
	String ssologinflag = (String)request.getSession(true).getAttribute("IS_SSO_LOGIN");
	if("Y".equals(ssologinflag)){

%>
<%----%>
	<script src="https://dp.michelin.com.cn/DP-Theme-1.0.0-SNAPSHOT/js/jquery.min.js"></script>
	<script id="universalout" type="text/javascript" src="https://dp.michelin.com.cn/DP-Theme-1.0.0-SNAPSHOT/js/validateIsDPLogin.js?<%=paras%>"></script> 

<%
	}
}
%>
    
    
<style>
.menu {
	font-family: Microsoft YaHei, sans-serif;
	margin:0 0 0 0;
	height:auto;
	width:115px;
/* 	background:url(images/menu/menu_bg.jpg); */
}
/* remove the bullets and set the margin and padding to zero for the unordered list */
.menu ul {
	padding:0;
	margin:0;
	list-style-type: none;
/* 	height: 45px; */
}
/* float the list so that the items are in a line and their position relative so that the drop down list will appear in the right place underneath each list item */
.menu ul li {
/* 	float:left; */
/* 	position:relative; */
 	background-color: #006EC1; 
 	margin: 3px 0 0 0;
}
/* style the links to be 104px wide by 30px high with a top and right border 1px solid white. Set the background color and the font size. */
.menu ul li a, .menu ul li a:visited {
	display:block;
	text-align:left;
	text-decoration:none;
	line-height:35px;
	color:#375874;
	font-size:15px;
	padding:0 12px 0 12px;
	float:left;
	font-weight:bold;
/* 	background:url(images/menu/fengefu.jpg) left top no-repeat; */
}
/* make the dropdown ul invisible */
.menu ul li ul {
/* 	display: none; */
}
/* .menu ul li a.homeMune,.menu ul li a:hover.homeMune{ background:url(images/menu/home_mune.jpg) center top no-repeat; padding-left:30px; } */

/* specific to non IE browsers */
/* set the background and foreground color of the main menu li on hover */


/* .menu ul li:hover a { */
/* 	color:#00a333; */
/* /* 	background:url(images/menu/menu_bg_over.jpg) left center repeat-x; */ */
/* 	padding-left:12px; */
/* } */
/* make the sub menu ul visible and position it beneath the main menu list item */
.menu ul li:hover ul {
	display:block;
	position:relative;
	top:0;
	left:0;
	z-index:10;
	border:0 solid #000;
}
/* style the background and foreground color of the submenu links */
.menu ul li a {
	display:block;
	background:#ffffff;
	color:#375874;
	width:91px;
	text-align:left;
/* 	padding-left:5px; */
	border-top:0px solid #3e3e3e;
}
/* style the background and forground colors of the links on hover */
.menu ul li a:hover {
	background:#F0EFED;
	color:#807D78;
}
.menu a,.menu ul li.homeMune a:hover{
	background:#F0EFED;
	color:#807D78;
}
#homeLink{
/* 	background: url(images/menu/nav01.jpg) no-repeat 0 0; */
/* 	padding: 0px 0px 0px 25px; */
/* 	width: 30px; */
}
#homeLink:hover{
/* 	background: url(images/menu/nav01on.jpg) no-repeat 0 0; */
/* 	padding: 0px 0px 0px 25px; */
/* 	width: 30px; */
}
/* #menu_title{ */
/* 	width: 115px; */
/* } */
.hide{
	font-size: 16px;
	color: #fff;
	line-height: 30px;
}
#info a {
  text-decoration: none;
  color: #10A450;
}
</style>
</head>
<body>
<%-- <form:form id="toUpdatePwd" action="${webcontext}/login/toUpdate" target="dms_inner" method="get"></form:form> --%>
<core:if test="${isFirstLogin == true}">
	<script>
		$(function(){
			loadLayer(this,"${webcontext}/login/toFirstLoginUpdatePwd",755,165,250,600);
		});
	</script>
</core:if>
	<div id="active1"></div>
    <div id="active2"></div>
	<!-- container -->
	<core:if test="${currentUser.userCode=='GLORIS'}">
		<style >
		#logo {
			height: 100px;
			position: relative;
			color: #c2d2db;
			background: url("./././images/logo/che-logo.jpg") no-repeat;
		}
		</style>
	</core:if>
	<div id="container">

		<!-- logo -->
		<div id="logo">
			<div class="right">
				<a id="exit" href="#" title="退出系统"></a>
			</div>
		</div>
        
		<!-- /logo -->


<!--菜单栏-->
	<div id="info">
			<a class="home" href="${webcontext}/${homePage}" target="dms_inner">首页</a>&nbsp;&nbsp;&nbsp;&nbsp;
			<a class="downLoad" href="${webcontext}/login/downloadFile">使用手册下载</a>
			<div class="info_left">
				<span class="role">
					<span>用户名：</span>
					<span>${currentUser.userCode }</span>
				</span>
				<span class="date">
					<span>登录时间：</span>
					<span><fmt:formatDate value="${currentUser.lastLoginTime }" pattern="yyyy-MM-dd HH:mm:ss" /></span>
				</span>
			</div>
		</div>
    <!--//菜单栏-->
		

		<!-- warn : doing success fail -->
<!-- 		<div id="warn"> -->
<!-- 			<p class="doing"> -->
<!-- 				<span>正在执行某项操作...</span> -->
<!-- 			</p> -->
<!-- 		</div> -->
		<!-- /warn -->

		<!-- content -->
		<div id="content">
			<!-- nav -->
			<div id="nav">
			<div>    
        <ul class="nav nav-pills nav-stacked">  
        <core:forEach items="${menuItems}" var="menu">  
            <li role="presentation" class="active"><a href="#">${menu.menuName}</a>
            	 <ul class="nav nav-pills nav-stacked" id="subMenu">
            		<core:forEach items="${menu.subMenus}" var="menuItem">
                    	<li role="presentation">
                    		<core:choose>
                    			<core:when test="${menuItem.absoluteUrl}">
                    				<a href="${menuItem.menuUrl}" target="dms_inner" >${menuItem.menuName}</a>
                    			</core:when>
                    			<core:otherwise>
                    			<a href='<core:url value="${menuItem.menuUrl}" />' target="dms_inner" >${menuItem.menuName}</a>
                    				<%-- <a href="${webcontext}/${menuItem.menuUrl}" target="dms_inner" >${menuItem.menuName}</a> --%>
                    			</core:otherwise>
                    		</core:choose>
                    	</li>
                    </core:forEach>
                </ul> 
                <!--[if lte IE 6]>
				</td></tr></table>
				</a>
				<![endif]-->
             </li> 
       
      </core:forEach>  
      </ul> 
      
<!--       <div id="endhomeLink"> -->
      	
<!--       </div> -->
    </div>
<!--				<div class="top">-->
<!--					<a id="set" title="设置快捷键" href="${webcontext}/ge/shortcutmenu/config" target="dms_inner">设置</a>-->
<!--				</div>-->
<!--				<div class="tags" id="shortMenu">-->
<!--				<core:forEach items="${shortcutMenu}" var="menu">-->
<!--					  <core:if test="${menu.url==''}"> -->
<!--							<img src="${imagepath}/${menu.phoneUrl}"/>-->
<!--							<div class="longtext" style="width:70px;" title="${menu.menuName}"><span>${menu.menuName}</span></div>-->
<!--						  </core:if>-->
<!--						  <core:if test="${menu.url!=''}"></core:if>-->
<!--							<a href="${menu.url}" target="dms_inner" class="shortcut" parentMenuName="${menu.parentMenuName}" secondMenuName="${menu.menuName}">-->
<!--								<img src="${imagepath}/${menu.phoneUrl}"/>-->
<!--								<div  style="width:68px;overflow:hidden;height:14px; height:12px\9;" title="${menu.menuName}"><span>${menu.menuName}</span></div>-->
<!--							</a>-->
<!--						<div class='line'></div>-->
<!--						-->
<!--				</core:forEach>-->
<!--				-->
<!--				</div>-->
			</div>
			<!-- /nav -->
			<!-- iframe_div -->
			<div id="iframe_div" class="iframe_divNoBod">
				<!-- iframe_top -->
				<div id="iframe_top"></div>
				<!-- /iframe_top -->
				<!-- iframe -->
				<div id="iframe">
					<iframe name="dms_inner" src="${webcontext}/${homePage}" width="100%" height="100%"
						frameborder="0" marginwidth="0" marginheight="0"  allowtransparency="true"></iframe>
				</div>
				<!-- /iframe -->
				<!-- iframe_bottom -->
				<div id="iframe_bottom"></div>
				<!-- dome_bottom -->
			</div>
			<!-- /iframe_div -->
		</div>
		<!-- /content -->

		<!-- info -->
		<!-- /info -->

	</div>
	<!-- /container -->

</body>
</html>